#ifndef _BL_CONFIG_H_
#define _BL_CONFIG_H_

#define VERSION "v1.0usb"
#define COMPILE_TIME_STAMP __DATE__" "__TIME__
#define BOOTLOADVERSION "3.5.f"
#define ELDR_MAGIC 0xadeafbee

/* default kernel boot argument */
#define BOOT_ARG0 0
#define BOOT_ARG1 0


/****************************************************************
 *
 *         Flash Memory Map
 *
 ****************************************************************/
#define BL_FLASH_START			0x00000000
#define BL_FLASH_LENGTH			0x00020000

#define TAT_FLASH_START			0x00020000
#define TAT_FLASH_LENGTH		0x00020000

#define KERNEL_FLASH_START		0x00040000
#define KERNEL_FLASH_LENGTH		0x00100000

#define ROOT_FLASH_START		0x00140000
#define ROOT_FLASH_LENGTH		0x00380000

#define USER_FLASH_START		0x004C0000
#define USER_FLASH_LENGTH		0x01800000

#define USERDATA_FLASH_START	0x01CC0000
#define USERDATA_FLASH_LENGTH	0x00220000

#define PTABLE_FLASH_START		0x01EE0000
#define PTABLE_FLASH_LENGTH		0x00020000

#define INITIMAGE_FLASH_START	0x01F00000
#define INITIMAGE_FLASH_LENGTH	0x00100000

#define DOC_PAGES_IN_BLOCK     (128)
#define DOC_PAGE_SIZE          (512)
#define DOC_BLOCK_SIZE         (DOC_PAGE_SIZE*DOC_PAGES_IN_BLOCK)

/* Size of FLASH storage */

#define BDK0_SIGN				"BOOT"
#define BDK1_SIGN				"BDKP"
#define LOGO_SIGN               "LOGO"
#define TATT_SIGN               "TATT"

#define BDK0_KEY              "01234567"
#define BDK1_KEY              "12345678"

#define BDK_NUMBER      2
#define BDTL_NUMBER     4

#define SIZE_128M                0x08000000L             /*128M*/

#define BDK0_LENGTH             (1024 * 1 * 1024L)       /*bootloader*/
#define BDK1_LENGTH             (1024 * 5 * 1024L)
#define LOGO_LENGTH             (1024 * 256)
#define TATT_LENGTH             (1024 * 256)
#define KERNEL_LENGTH           (1024 * 4 * 1024L)
#define BDTL0_LENGTH            (1024 * 72 * 1024L)      /* smartphone */
#define BDTL1_LENGTH            (1024 * 20 * 1024L)      /* user data */
#define BDTL2_LENGTH            (1024 * 8 * 1024L)      /* USB Storage */
#define BDTL3_LENGTH            0                        /* Temp Dir, log*/



#define LOGO_SUBPARTITION       (4*DOC_BLOCK_SIZE)


/* memory address */
#define RAM_START				0xA0000000
#define RAM_BOOT_LOADER_AREA_START_OFFSET_FROM_RAM_START 0x03C00000
#define RAM_BOOT_LOADER_AREA_LENGTH  0x00100000
#define RAM_STACK_END_OFFSET_FROM_RAM_START 0x03FFFFFC
#define KERNEL_RAM_START		0xA0020000
#define IPL_RAM_OFFSET	        (16*1024*1024)
#define SPL_RAM_OFFSET	        (IPL_RAM_OFFSET + 1*1024*1024)
#define TATT_RAM_OFFSET         (SPL_RAM_OFFSET + 1*1024*1024)
#define UDL_RAM_OFFSET          (32*1024*1024) // 32M
#define FLASHOFF         0x40000
#define KERNELLEN        0x500000

/******************************************************************/
/*      Peripheral settings                                       */
/******************************************************************/
/* default serial port */
#define ENABLE_STUART
//#define ENABLE_FFUART
//#define ENABLE_BTUART

#define CONFIG_USBSERIAL_SUPPORT

/* serial port */
#define TERMINAL_SPEED baud_115200

/* internal timer resolution */
#define TIMER_TICK_PER_SEC 100 /* timer interrupt per sec. */

#endif // _BL_CONFIG_H_
